﻿using System.Collections.Generic;
using Andromeda.Base.Application.UI.Windows.Controls;
using Andromeda.Forge.Common;

namespace ForgeIt.UserControls
{
    /// <summary>
    /// 
    /// </summary>
    public partial class FieldUserControl : FO_UserControl
    {
        /// <summary>
        /// 
        /// </summary>
        public FieldUserControl()
        {
            InitializeComponent();
        }

        /// <summary>
        /// 
        /// </summary>
        public FOField Record
        {
            get;
            set;
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="record"></param>
        public void DataBind(FOField record)
        {
            SuspendLayout();

            Record = record;

            globalBindingSource.DataSource = Record;
            List<AccessModifierAttribute> accessModifier = new List<AccessModifierAttribute>();
            accessModifier.AddRange(new[]
                                        {
                                            AccessModifierAttribute.Private, AccessModifierAttribute.Protected,
                                            AccessModifierAttribute.Public
                                        });

            accessModifierComboBox.DataSource = accessModifier;

            List<InheritanceModifierAttribute> inheritanceModifier = new List<InheritanceModifierAttribute>();
            inheritanceModifier.AddRange(new[]
                                             {
                                                 InheritanceModifierAttribute.Abstract,
                                                 InheritanceModifierAttribute.New, InheritanceModifierAttribute.None,
                                                 InheritanceModifierAttribute.Override,
                                                 InheritanceModifierAttribute.Sealed,
                                                 InheritanceModifierAttribute.Static,
                                                 InheritanceModifierAttribute.Virtual
                                             });

            inheritanceModifierComboBox.DataSource = inheritanceModifier;

            ResumeLayout();
        }

    }
}
